package main

import (
	"fmt"
	"time"
)

func main() {

	//到达指定的时间之后执行一次
	timer := time.NewTimer(time.Second * 2)


	 go func() {

		 <- timer.C

		 fmt.Println("timer .........")

	 }()

	//立即停止定时器,
	//timer.Stop()

	//重置定时器执行时间
	timer.Reset(time.Second *5)

	after := time.After(time.Second * 2)


	v,e := <- after

	fmt.Printf("v type is %T , e type is %T \n",v,e)

	for ; ;  {
		
	}
}


